using UnityEngine;
using System.Collections;

public enum MessageID
{
	MSGID_NONE = -1
	
,	MSGID_DUMMY

,	MSGID_QUEST_START
,	MSGID_QUEST_DRAGONSLAYER_ACTIVATION
,	MSGID_QUEST_DRAGONSLAYER_ALL_WEAPONS
,	MSGID_QUEST_DRAGONSLAYER_DRAGON_HIT
,	MSGID_QUEST_DRAGONSLAYER_RESCUED
,	MSGID_QUEST_DRAGONSLAYER_TO_HOME
,	MSGID_QUEST_END

,	MSGID_TOY_PERFORM_SELECTION
,	MSGID_TOY_PERFORM_ACTION
,	MSGID_TOY_PERFORM_DROP
,	MSGID_TOY_ACQUIRED

,	MSGID_STOP_INTERACTION
,	MSGID_START_INTERACTION
	
,	MSGID_COUNT
}

public class BM_BaseMessage
{
	public MessageID			m_eMessageID = MessageID.MSGID_NONE;
	public BM_MessageHandler	m_rSender = null;
	
	public BM_BaseMessage(MessageID eMessageID, BM_MessageHandler rSender)
	{
		m_eMessageID = eMessageID;
		m_rSender = rSender;
	}
	
	public override string ToString()
	{
		return "MessageID: " + m_eMessageID;
	}
}

public class BM_QuestActivationMessage : BM_BaseMessage
{
	public bool				m_bActive = false;
	
	public BM_QuestActivationMessage(MessageID eMessageID, BM_MessageHandler rSender, bool bActive)
		: base(eMessageID, rSender)
	{
		if(eMessageID <= MessageID.MSGID_QUEST_START || eMessageID >= MessageID.MSGID_QUEST_END)
			Debug.LogError(GetType()+"-> Errore Massaggio non riconosciuto!");
		
		m_bActive = bActive;
	}
}

public class BM_ToySelectionMessage : BM_BaseMessage
{
	public BM_BaseToy.Toy		m_eSelectedToyName = BM_BaseToy.Toy.TOY_NONE;
	
	public BM_ToySelectionMessage(BM_BaseToy.Toy eSelectedToyName, BM_MessageHandler rSender)
		: base(MessageID.MSGID_TOY_PERFORM_SELECTION, rSender)
	{
		m_eSelectedToyName = eSelectedToyName;
	}
}

//public class SV_ChordState_Message : SV_BaseMessage
//{
//	public Transition	m_eTransitionName;
//	public string		m_strStringField_1 = "";
//	public string		m_strStringField_2 = "";
//	public string		m_strStringField_3 = "";
//	public int			m_iIntField_1 = -1;
//	public byte[]		m_vPayload = null;
//	
//	public SV_ChordState_Message(Transition eTransitionName, string strStringField_1, string strStringField_2, string strStringField_3, int iIntField_1, byte[] vPayload, SV_MessageHandler rSender)
//		: base(MessageID.MSGID_CHORD_EVENT, rSender)
//	{
//		m_eTransitionName = eTransitionName;
//		m_strStringField_1 = strStringField_1;
//		m_strStringField_2 = strStringField_2;
//		m_strStringField_2 = strStringField_3;
//		m_iIntField_1 = iIntField_1;
//		m_vPayload = vPayload;
//	}
//	
//	public override string ToString()
//	{
//		return "MessageID: " + m_eMessageID + " - Transition: " + m_eTransitionName + " - StringField_1: " + m_strStringField_1 + " - StringField_2: " + m_strStringField_2 + " - StringField_3: " + m_strStringField_3 + " - IntField_1: " + m_iIntField_1;
//	}
//}
//
//public class SV_PayloadSend_Message : SV_BaseMessage
//{
//	public SV_Payload_Base		m_rNetMessage = null;
//	
//	public SV_PayloadSend_Message(SV_Payload_Base rNetMessage, SV_MessageHandler rSender)
//		: base(MessageID.MSGID_NET_MESSAGE_SEND, rSender)
//	{
//		m_rNetMessage = rNetMessage;
//	}
//	
//	public override string ToString()
//	{
//		return "MessageID: " + m_eMessageID + " - PayloadID: " + m_rNetMessage.m_ePayloadID;
//	}
//}
//
//public class SV_PayloadReceive_Message : SV_BaseMessage
//{
//	public SV_Payload_Base		m_rNetMessage = null;
//	
//	public SV_PayloadReceive_Message(SV_Payload_Base rNetMessage, SV_MessageHandler rSender)
//		: base(MessageID.MSGID_NET_MESSAGE_RECEIVE, rSender)
//	{
//		m_rNetMessage = rNetMessage;
//	}
//	
//	public override string ToString()
//	{
//		return "MessageID: " + m_eMessageID + " - PayloadID: " + m_rNetMessage.m_ePayloadID;
//	}
//}
//
//public class SV_HostGameMsg : SV_BaseMessage
//{
//	public int		m_iComponentId = -1;
//	public int		m_iEventId = -1;
//	public float	m_fField_1 = 0.0f;
//	public float	m_fField_2 = 0.0f;
//	public float	m_fField_3 = 0.0f;
//	
//	public SV_HostGameMsg(int iComponentId, int iEventId, float fField_1, float fField_2, float fField_3, SV_MessageHandler rSender)
//		: base(MessageID.MSGID_HOST_GAME, rSender)
//	{
//		m_iComponentId = iComponentId;
//		m_iEventId = iEventId;
//		m_fField_1 = fField_1;
//		m_fField_2 = fField_2;
//		m_fField_3 = fField_3;
//	}
//	
//	public override string ToString()
//	{
//		return "MessageID: " + m_eMessageID + " - ComponentId: " + m_iComponentId + " - EventId: " + m_iEventId + " - Field_1: " + m_fField_1 + " - Field_2: " + m_fField_2 + " - Field_3: " + m_fField_3;
//	}
//}
//
//public class SV_TimeBasedMsg : SV_BaseMessage
//{
//	private float m_fTime = 0.0f;
//	
//	public float TimeValue
//	{
//		get { return m_fTime; }
//	}
//		
//	public SV_TimeBasedMsg(float fTime, MessageID eMessage, SV_MessageHandler rSender)
//		: base(eMessage, rSender)
//	{
//		m_fTime = fTime;
//	}
//	
//	public override string ToString()
//	{
//		return "MessageID: " + m_eMessageID + " - Time: " + m_fTime;
//	}
//}
//
//public class SV_LeaderUIActionMsg : SV_BaseMessage
//{
//	public GP_NetworkPage.NetworkPageAction		m_eAction = GP_NetworkPage.NetworkPageAction.NPACTION_NONE;
//	public int		m_iData_1 = 0;
//	public int		m_iData_2 = 0;
//	public int		m_iData_3 = 0;
//	
//	public SV_LeaderUIActionMsg(GP_NetworkPage.NetworkPageAction eAction, int iData_1, int iData_2, int iData_3, SV_MessageHandler rSender)
//		: base(MessageID.MSGID_HOST_LEADERUIACTION, rSender)
//	{
//		m_eAction = eAction;
//		m_iData_1 = iData_1;
//		m_iData_2 = iData_2;
//		m_iData_3 = iData_3;	
//	}
//	
//	public override string ToString()
//	{
//		return "Action: " + m_eAction + " - Data_1: " + m_iData_1 + " - Data_2: " + m_iData_2 + " - Data_3: " + m_iData_3;
//	}
//}
//
//public class SV_CustomizationSessionMsg : SV_BaseMessage
//{
//	public int		m_iCustomSessionsCount = 0;
//	public int		m_iSPenSessionsCount = 0;
//	public Dress	m_eDress = Dress.DRESS_NONE;
//	public Head		m_eHead = Head.HEAD_NONE;
//	public Coat		m_ePrimaryCoat = Coat.COAT_NONE;
//	public Coat		m_eSecondaryCoat = Coat.COAT_NONE;
//	
//	public SV_CustomizationSessionMsg(Dress eDress, Head eHead, Coat ePrimaryCoat, Coat eSecondaryCoat, SV_MessageHandler rSender)
//		: base(MessageID.MSGID_FLURRY_CUSTOMIZATION_SESSION, rSender)
//	{
//		m_iCustomSessionsCount = SV_AppDataManager.Instance().CustomSessionsCount;
//		m_iSPenSessionsCount = SV_AppDataManager.Instance().SPenSessionsCount;
//		
//		m_eDress = eDress;
//		m_eHead = eHead;
//		m_ePrimaryCoat = ePrimaryCoat;
//		m_eSecondaryCoat = eSecondaryCoat;
//	}
//	
//	public override string ToString()
//	{
//		return "CustomSessionsCount: "+m_iCustomSessionsCount+" - SPenSessionsCount: "+m_iSPenSessionsCount+" - Head: "+m_eHead+" - Dress: "+m_eDress+" - PrimaryCoat: "+m_ePrimaryCoat+" - SecondaryCoat: "+m_eSecondaryCoat;
//	}
//}
//
//public class SV_TourSelectionMsg : SV_BaseMessage
//{
//	public enum Type
//	{
//		TYPE_NONE = -1
//		
//	,	TYPE_MULTI_WIFI
//	,	TYPE_MULTI_GROUPPLAY
//		
//	,	TYPE_COUNT
//	}
//	
//	public TourName		m_eTourName = TourName.TOUR_NONE;
//	public Type			m_eGameType = Type.TYPE_NONE;
//	public int			m_iTotalTourCount = 0;
//	public int			m_iPartialTourCount = 0;
//	
//	
//	public SV_TourSelectionMsg(TourName eTourName, Type eGameType, SV_MessageHandler rSender)
//		: base(MessageID.MSGID_FLURRY_TOUR_SELECTION, rSender)
//	{
//		m_eTourName = eTourName;
//		m_eGameType = eGameType;
//		m_iTotalTourCount = SV_AppDataManager.Instance().GetTotalTourCount();
//		m_iPartialTourCount = SV_AppDataManager.Instance().GetTourCount(m_eTourName);
//	}
//	
//	public override string ToString()
//	{
//		return "TourName: " +m_eTourName+" - GameType: "+m_eGameType+" - TotalTourCount: "+m_iTotalTourCount+" - PartialTourCount: "+m_iPartialTourCount;
//	}
//}
//
//public class SV_LevelSelectionMsg : SV_BaseMessage
//{
//	public LevelName	m_eLevelName = LevelName.LEVEL_NONE;
//	public Dress		m_eDress = Dress.DRESS_NONE;
//	public Head			m_eHead = Head.HEAD_NONE;
//	public Coat			m_ePrimaryCoat = Coat.COAT_NONE;
//	public Coat			m_eSecondaryCoat = Coat.COAT_NONE;
//	public int			m_iTotalLevelCount = 0;
//	public int			m_iPartialLevelCount = 0;
//	public int			m_iHumanPlayersCount = 0;
//	
//	public SV_LevelSelectionMsg(LevelName eLevelName, int iHumanPlayerscount, Dress eDress, Head eHead, Coat ePrimaryCoat, Coat eSecondaryCoat, SV_MessageHandler rSender)
//		: base(MessageID.MSGID_FLURRY_LEVEL_SELECTION, rSender)
//	{
//		m_eLevelName = eLevelName;
//		m_iHumanPlayersCount = iHumanPlayerscount;
//		
//		m_eDress = eDress;
//		m_eHead = eHead;
//		m_ePrimaryCoat = ePrimaryCoat;
//		m_eSecondaryCoat = eSecondaryCoat;
//		
//		m_iTotalLevelCount = SV_AppDataManager.Instance().GetTotalLevelCount();
//		m_iPartialLevelCount = SV_AppDataManager.Instance().GetLevelCount(m_eLevelName);
//	}
//	
//	public override string ToString()
//	{
//		return "LevelName: " +m_eLevelName+" - HumanPlayersCount: "+m_iHumanPlayersCount+" - Head: "+m_eHead+" - Dress: "+m_eDress+" - PrimaryCoat: "+m_ePrimaryCoat+" - SecondaryCoat: "+m_eSecondaryCoat+" - TotalLevelCount: "+m_iTotalLevelCount+" - PartialLevelCount: "+m_iPartialLevelCount;
//	}
//}

